package com.daifeng.gulimall.product.feign;


import com.daifeng.common.to.SkuReductionTo;
import com.daifeng.common.to.SpuBoundsTo;
import com.daifeng.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

//声明这个此接口为一个远程客户端  可调用nacos中的mall-coupon中的服务
//微服务的客户端   value对应服务的id名 这样就可以使Feign客户端直接找到对应的微服务
//fallbackFactory  指定降级配置类
@FeignClient(value = "mall-coupon",fallbackFactory = CouponServiceFallbackFactory.class)
public interface CouponServiceFeign {


    /**
     *   这个的路径要对应mall-coupon服务的全路径
     */
    @PostMapping("/coupon/spubounds/save")
    public R save(@RequestBody SpuBoundsTo spuBounds);

    /**
     * 保存满减优惠信息
     * @param skuReductionTo
     * @return
     */
    @PostMapping("/coupon/skufullreduction/saveSkuReduction")
    public R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);






}
